package com.zhisheng.day10_tlias.mapper;

import com.zhisheng.day10_tlias.entry.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    List<Dept> list();

    @Delete("delete from dept where id=#{id}")
    int delById(Integer id);

    @Select("select * from dept where  id = #{id}")
    Dept getById(Integer id);

    int updateById(Dept dept);

    @Insert("insert into dept values (null,#{name},#{createTime},#{updateTime})")
    int insert(Dept dept);
}
